home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Game-Power
/
Amiga Game-Power.iso
/
anwendungen
/
gw print
/
structurebrowser_v1.3
/
sources
/
sbtext.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-05-20
|
3KB
|
124 lines
/*
Handles TextFont and TextAttr structures
Not implemented:
TextFont.tf_Message
TextFont.tf_CharData
TextFont.tf_CharLoc
TextFont.tf_CharSpace
TextFont.tf_CharKern
*/
#include "header/sb.h"
extern int level; /* recursion level */
static char *stylenames[8] = {
"FSF_UNDERLINED", "FSF_BOLD", "FSF_ITALIC", "FSF_EXTENDED"
};
static char *flags[8] = {
"FPF_ROMFONT", "FPF_DISKFONT", "FPF_REVPATH", "FPF_TALLDOT",
"FPF_WIDEDOT", "FPF_PROPORTIONAL", "FPF_DESIGNED", "FPF_REMOVED"
};
/* PrTextAttr
Print data for a TextAttr structure
*/
PrTextAttr (string, textattr)
char *string;
struct TextAttr *textattr;
{
static struct StructData structdata[] = {
{ " ta_Name", "STRPTR", PRSTRING, PTRSIZE },
{ "-ta_YSize", "UWORD", PRUINT, INTSIZE },
{ " ta_Style", "UBYTE", PRBYTE, BYTESIZE },
{ " ta_Flags", "UBYTE", PRBYTE, BYTESIZE }
};
int i, sum;
int choice = -1;
level++;
while (choice)
{
sum = SetOptionText(string, structdata, (APTR)textattr, DATASIZE, 0);
switch (choice = GetChoice(DATASIZE))
{
case 1:
if (textattr->ta_Name)
PrString("The name of the Font", textattr->ta_Name);
break;
case 3:
FlagPrint("The style bits set for this Font",
stylenames, (ULONG)textattr->ta_Style);
break;
case 4:
FlagPrint("The flag bits set for this Font",
flags, (ULONG)textattr->ta_Flags);
break;
}
}
level--;
}
/* PrTextFont
Print data for a TextFont structure
*/
PrTextFont (string, textfont)
char *string;
struct TextFont *textfont;
{
static struct StructData structdata[] = {
{ "(tf_Message", "struct Message)", PRNULL, SZ(Message) },
{ "-tf_YSize", "UWORD", PRUINT, INTSIZE },
{ " tf_Style", "UBYTE", PRBYTE, BYTESIZE },
{ " tf_Flags", "UBYTE", PRBYTE, BYTESIZE },
{ "-tf_XSize", "UWORD", PRUINT, INTSIZE },
{ "-tf_BaseLine", "UWORD", PRUINT, INTSIZE },
{ "-tf_BoldSmear", "UWORD", PRUINT, INTSIZE },
{ "-tf_Accessors", "UWORD", PRUINT, INTSIZE },
{ "-tf_LoChar", "UBYTE", PRBYTE, BYTESIZE },
{ "-tf_HiChar", "UBYTE", PRBYTE, BYTESIZE },
{ "(tf_CharData", "APTR)", PRPTR, PTRSIZE },
{ "-tf_Modulo", "UWORD", PRUINT, INTSIZE },
{ "(tf_CharLoc", "APTR)", PRPTR, PTRSIZE },
{ "(tf_CharSpace", "APTR)", PRPTR, PTRSIZE },
{ "(tf_CharKern", "APTR)", PRPTR, PTRSIZE }
};
int i, sum;
int choice = -1;
level++;
while (choice)
{
sum = SetOptionText(string, structdata, (APTR)textfont, DATASIZE, 0);
switch (choice = GetChoice(DATASIZE))
{
case 3:
FlagPrint("The style bits set for this Font",
stylenames, (ULONG)textfont->tf_Style);
break;
case 4:
FlagPrint("The flag bits set for this Font",
flags, (ULONG)textfont->tf_Flags);
break;
}
}
level--;
}